-
-
Notifications
You must be signed in to change notification settings - Fork 12
feat(orm): add settings to disallow query-time omit override #443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a new Client.$setOptions(...) API, a new client option Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
📚 Learning: 2025-11-26T01:55:04.540ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @ymc9's task —— View job Code Review for feat/rpc-api-omitI've completed my analysis of the pull request. This change adds a new setting Todo List
Review Summary✅ Positive Aspects
🔍 Code Quality & Best PracticesGood practices observed:
Minor suggestions:
🐛 Potential IssuesNo significant bugs found, but some considerations:
⚡ Performance ConsiderationsMinimal performance impact:
🔒 Security ConcernsNo security issues identified:
🧪 Test CoverageExcellent test coverage:
Test file changes:
📋 Specific Code Review Notespackages/orm/src/client/options.ts:88-92
packages/orm/src/client/crud/validator/index.ts:790-796
tests/e2e/orm/client-api/omit.test.ts:144-161
🎯 Recommendations
Overall AssessmentThis is a well-implemented feature that adds useful functionality for controlling field omission behavior. The code quality is high, test coverage is comprehensive, and the implementation follows established patterns in the codebase. The feature enhances security and control without introducing breaking changes. Recommendation: ✅ Approve with minor suggestions above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new client option allowQueryTimeOmitOverride to control whether fields marked with @omit can be overridden at query time. When set to false, attempting to set an omitted field to false in a query's omit clause will trigger a validation error. The PR also introduces a new $setOptions method and deprecates the existing $setInputValidation method.
- Adds
allowQueryTimeOmitOverrideoption (defaults totruefor backward compatibility) - Introduces
$setOptionsmethod for setting arbitrary client options - Deprecates
$setInputValidationin favor of$setOptions
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/orm/src/client/options.ts | Added allowQueryTimeOmitOverride option definition with documentation |
| packages/orm/src/client/contract.ts | Added $setOptions method signature and deprecated $setInputValidation |
| packages/orm/src/client/client-impl.ts | Implemented $setOptions method |
| packages/orm/src/client/crud/validator/index.ts | Updated omit schema validation to enforce allowQueryTimeOmitOverride setting |
| tests/e2e/orm/client-api/omit.test.ts | Added test coverage for the new allowQueryTimeOmitOverride setting |
| tests/e2e/orm/validation/custom-validation.test.ts | Migrated from deprecated $setInputValidation to $setOptions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <[email protected]>
|
Claude finished @ymc9's task —— View job Code Review for feat/rpc-api-omitI've completed my analysis of the pull request. This change adds a new setting Todo List
Review Summary✅ Positive Aspects
🔍 Code Quality & Best PracticesGood practices observed:
Minor suggestions:
🐛 Potential IssuesNo significant bugs found, but some considerations:
⚡ Performance ConsiderationsMinimal performance impact:
🔒 Security ConcernsNo security issues identified:
🧪 Test CoverageExcellent test coverage:
Test file changes:
📋 Specific Code Review Notespackages/orm/src/client/options.ts:88-92
packages/orm/src/client/crud/validator/index.ts:790-796
tests/e2e/orm/client-api/omit.test.ts:144-161
🎯 Recommendations
Overall AssessmentThis is a well-implemented feature that adds useful functionality for controlling field omission behavior. The code quality is high, test coverage is comprehensive, and the implementation follows established patterns in the codebase. The feature enhances security and control without introducing breaking changes. Recommendation: ✅ Approve with minor suggestions above |
Summary by CodeRabbit
New Features
$setOptionsto reconfigure client instances with new options.allowQueryTimeOmitOverrideoption to control query-time field-omit overrides.computedFieldsconfiguration optional in client setup.Tests
✏️ Tip: You can customize this high-level summary in your review settings.